package org.mobiletrain.android43_activeandroid;

import android.app.Application;

import com.activeandroid.ActiveAndroid;
import com.activeandroid.Configuration;

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Configuration configuration = new Configuration.Builder(this)
                .setDatabaseName("db_students")
                .setDatabaseVersion(1)
                .setModelClasses(Student.class)
                .create();
        ActiveAndroid.initialize(configuration);
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        ActiveAndroid.dispose();
    }
}
